﻿Imports System.Data.SqlClient
Imports UTNComputers.clsCatalogo
Public Class clsVentas_Detalle
    Private mVtadte_Id As Int32
    Private mVta_Id As Int32
    Private mProd_Id As Int32
    Private mNro_Serie As String
    Private mVtadte_Cantidad As Int32
    Private mProducto As clsCatalogo
    Private mCod_Suc As Int32


    '/////////////////////////////////////////////////////////
    '/ Propiedades
    '/////////////////////////////////////////////////////////


    Public Property Vtadte_Id() As Int32
        Get
            Return mVtadte_Id
        End Get
        Set(ByVal value As Int32)
            If value > 0 And value < 2000000000 Then
                mVtadte_Id = value
            Else
                Throw New Exception("No se puede utilizar el código del detalle de venta. El código debe ser mayor a cero (0).")
            End If
        End Set
    End Property

    Public Property Vta_Id() As Int32
        Get
            Return mVta_Id
        End Get
        Set(ByVal value As Int32)
            If value > 0 And value < 2000000000 Then
                mVta_Id = value
            Else
                Throw New Exception("No se puede utilizar el código de venta. El código debe ser mayor a cero (0).")
            End If
        End Set
    End Property
    Public Property Prod_Id() As Int32
        Get
            Return mProd_Id
        End Get
        Set(ByVal value As Int32)
            If value > 0 And value < 2000000000 Then
                mProd_Id = value
            Else
                Throw New Exception("No se puede utilizar el código del producto. El código debe ser mayor a cero (0).")
            End If
        End Set
    End Property
    Public Property Nro_Serie() As String
        Get
            Return mNro_Serie
        End Get
        Set(ByVal value As String)
            mNro_Serie = Left(value, 20)
        End Set
    End Property

    Public Property Vtadte_Cantidad() As Int32
        Get
            Return mVtadte_Cantidad
        End Get
        Set(ByVal value As Int32)
            If value > 0 And value < 2000000000 Then
                mVtadte_Cantidad = value
            Else
                Throw New Exception("No se puede utilizar cantidad. La cantidad debe ser mayor a cero (0).")
            End If
        End Set
    End Property
    Public Property Producto() As clsCatalogo
        Get
            Return mProducto
        End Get
        Set(ByVal value As clsCatalogo)
            mProducto = value
        End Set
    End Property
    Public Property Cod_Suc() As Int32
        Get
            Return mCod_Suc
        End Get
        Set(ByVal value As Int32)
            If value > 0 And value < 2000000000 Then
                mCod_Suc = value
            Else
                Throw New Exception("Codigo de sucursal incorrecto")
            End If
        End Set
    End Property
    '/////////////////////////////////////////////////////////
    '/ Métodos de la Clase
    '/////////////////////////////////////////////////////////

    '---------------------------------------------------------------------
    ' Constructor de la Clase
    '---------------------------------------------------------------------
    Public Sub New()

        MyBase.New()

    End Sub
    '---------------------------------------------------------------------
    ' Destructor de la Clase
    '---------------------------------------------------------------------
    Public Sub Dispose()

        MyBase.Finalize()

    End Sub

End Class
